1. Field of the Invention
The present invention relates to a picture processing method in an optical measuring apparatus which comprises a projector for radiating a slit light on a workpiece and an image sensing device for picturing an optical cross-sectional image (i.e., an image of light representing the cross section) which is formed by the slit light radiated on the workpiece, the projector and the image sensing device being so arranged that the optical axis of the slit light and the optical axis of the image sensing device cross each other at an oblique angle.
2. Description of the Related Art
It is conventionally known to use the above described kind of optical measuring apparatus to measure the shape and the position of a workpiece from an optical cross-sectional image on a screen of an image sensing device. In such a method, if there is a reference portion for measurement such as a corner in the optical cross-sectional image, it will be possible to measure the shape and the position of the workpiece on the basis of that reference portion. If, on the other hand, there is no such reference portion, it is considered to calculate equations for image lines of two predetermined image portions of the optical cross-sectional image, to obtain the position of a crossing point of the two image lines so that this crossing point can be used as an alternative to the corner.
The optical cross-sectional image becomes a band-like image having a certain degree of width. Therefore, when the equations for the image lines must be calculated as described above, windows are set at a plurality of positions in the optical cross-sectional image, a point of center of gravity of the optical cross-sectional image in each of these windows is measured, and equations for the image lines are calculated from these points of centers of gravity by regarding them to be curves or straight lines passing through those points of centers of gravity.
When the image lines are calculated, as described above, from the points of centers of gravity by setting windows, the setting positions of the windows must be changed depending on the displacement of the optical cross-sectional image so that, even if the optical cross-sectional image is displaced on a screen, the windows may be set in predetermined positions of the image.
Here, let an X-axis direction be in that coordinate direction on the screen which corresponds to the optical axis direction of the slit light, and let a Y-axis direction be in the direction which is perpendicular to the X-axis direction. Since the optical axis of the image sensing device is slightly inclined relative to the optical axis of the slit light, if the workpiece is displaced towards or away from the projector in the optical axis direction of the slit light, the optical cross-sectional image displaces on the screen in one or the other X-axis direction and, at the same time, the image is magnified or contracted in the Y-axis direction at a rate of magnification depending on the amount of displacement thereof in the X-axis direction. Therefore, if only the setting positions of the windows are changed depending on the displacement of the optical cross-sectional image, the relative positional relationship between the optical cross-sectional image and the windows will be deviated or offset depending on the changes in the rate of magnification of the image, with the result that the equations for the image lines cannot be correctly calculated.